package com.chen.nio;

import java.nio.ByteBuffer;

public class NioTest1 {

    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocate(100);
        String hello = "hello";
        buffer.put(hello.getBytes());
        buffer.flip();
        System.out.println(new String(hello.getBytes(), 0, buffer.limit()));
    }

}
